<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>boost/python/object.hpp</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Python Reference Manual">
<link rel="up" href="../object_wrappers.html" title="Chapter 3. Object Wrappers">
<link rel="prev" href="boost_python_long_hpp.html" title="boost/python/long.hpp">
<link rel="next" href="boost_python_str_hpp.html" title="boost/python/str.hpp">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../../images/boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost_python_long_hpp.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../object_wrappers.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="boost_python_str_hpp.html"><img src="../../images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="object_wrappers.boost_python_object_hpp"></a><a class="link" href="boost_python_object_hpp.html" title="boost/python/object.hpp">boost/python/object.hpp</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.introduction">Introduction</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_nil">Class
        <code class="computeroutput"><span class="identifier">slice_nil</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_attribute_policies">Class
        <code class="computeroutput"><span class="identifier">const_attribute_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_attribute_policies_s">Class
        <code class="computeroutput"><span class="identifier">const_attribute_policies</span></code>
        static functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_attribute_policies">Class
        <code class="computeroutput"><span class="identifier">attribute_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_attribute_policies_static_">Class
        <code class="computeroutput"><span class="identifier">attribute_policies</span></code> static
        functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_objattribute_policie">Class
        <code class="computeroutput"><span class="identifier">const_objattribute_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_objattribute_polici0">Class
        <code class="computeroutput"><span class="identifier">const_objattribute_policies</span></code>
        static functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_objattribute_policies">Class
        <code class="computeroutput"><span class="identifier">objattribute_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_objattribute_policies_stat">Class
        <code class="computeroutput"><span class="identifier">objattribute_policies</span></code> static
        functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_item_policies">Class
        <code class="computeroutput"><span class="identifier">const_item_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_item_policies_static">Class
        <code class="computeroutput"><span class="identifier">const_item_policies</span></code> static
        functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_item_policies">Class
        <code class="computeroutput"><span class="identifier">item_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_item_policies_static_funct">Class
        <code class="computeroutput"><span class="identifier">item_policies</span></code> static functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_slice_policies">Class
        <code class="computeroutput"><span class="identifier">const_slice_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_slice_policies_stati">Class
        <code class="computeroutput"><span class="identifier">const_slice_policies</span></code> static
        functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_policies">Class
        <code class="computeroutput"><span class="identifier">slice_policies</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_policies_static_func">Class
        <code class="computeroutput"><span class="identifier">slice_policies</span></code> static functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_object_operators">Class
        template <code class="computeroutput"><span class="identifier">object_operators</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_object_operators_">Class
        template <code class="computeroutput"><span class="identifier">object_operators</span></code>
        observer functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object">Class
        <code class="computeroutput"><span class="identifier">object</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object_constructors_and_de">Class
        <code class="computeroutput"><span class="identifier">object</span></code> constructors and destructor</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object_modifiers">Class
        <code class="computeroutput"><span class="identifier">object</span></code> modifiers</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code></a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy_observer_fu">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code> observer functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy_modifier_fu">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code> modifier functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.functions">Functions</a></span></dt>
<dt><span class="section"><a href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.example">Example</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.introduction"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.introduction" title="Introduction">Introduction</a>
</h3></div></div></div>
<p>
          Exposes the generic Python object wrapper class object, and related classes.
          In order to avoid some potenential problems with argument-dependent lookup
          and the generalized operators defined on object, all these facilities are
          defined in namespace boost::python::api, and object is imported into namespace
          boost::python with a using-declaration.
        </p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_slice_nil"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_nil" title="Class slice_nil">Class
        <code class="computeroutput"><span class="identifier">slice_nil</span></code></a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">slice_nil</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">_</span> <span class="special">=</span> <span class="identifier">slice_nil</span><span class="special">();</span>
</pre>
<p>
          A type that can be used to get the effect of leaving out an index in a
          Python slice expression:
        </p>
<pre class="programlisting"><span class="special">&gt;&gt;&gt;</span> <span class="identifier">x</span><span class="special">[:-</span><span class="number">1</span><span class="special">]</span>
<span class="special">&gt;&gt;&gt;</span> <span class="identifier">x</span><span class="special">[::-</span><span class="number">1</span><span class="special">]</span>
</pre>
<p>
          C++ equivalent:
        </p>
<pre class="programlisting"><span class="identifier">x</span><span class="special">.</span><span class="identifier">slice</span><span class="special">(</span><span class="identifier">_</span><span class="special">,-</span><span class="number">1</span><span class="special">)</span>
<span class="identifier">x</span><span class="special">[</span><span class="identifier">slice</span><span class="special">(</span><span class="identifier">_</span><span class="special">,</span><span class="identifier">_</span><span class="special">,-</span><span class="number">1</span><span class="special">)]</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_attribute_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_attribute_policies" title="Class const_attribute_policies">Class
        <code class="computeroutput"><span class="identifier">const_attribute_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an attribute access
          to a const object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">const_attribute_policies</span>
  <span class="special">{</span>
      <span class="keyword">typedef</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key_type</span><span class="special">;</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_attribute_policies_s"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_attribute_policies_s" title="Class const_attribute_policies static functions">Class
        <code class="computeroutput"><span class="identifier">const_attribute_policies</span></code>
        static functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an <a class="link" href="../glossary.html#ntbs">ntbs</a>.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the attribute of target named by key.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                An object managing the result of the attribute access.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_attribute_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_attribute_policies" title="Class attribute_policies">Class
        <code class="computeroutput"><span class="identifier">attribute_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an attribute access
          to a mutable object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">attribute_policies</span> <span class="special">:</span> <span class="identifier">const_attribute_policies</span>
  <span class="special">{</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
      <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_attribute_policies_static_"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_attribute_policies_static_" title="Class attribute_policies static functions">Class
        <code class="computeroutput"><span class="identifier">attribute_policies</span></code> static
        functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an <a class="link" href="../glossary.html#ntbs">ntbs</a>.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                sets the attribute of target named by key to value.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">target</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an <a class="link" href="../glossary.html#ntbs">ntbs</a>.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                deletes the attribute of target named by key.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_objattribute_policie"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_objattribute_policie" title="Class const_objattribute_policies">Class
        <code class="computeroutput"><span class="identifier">const_objattribute_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an attribute access
          to a const object when the attribute name is given as a const object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">const_objattribute_policies</span>
  <span class="special">{</span>
      <span class="keyword">typedef</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key_type</span><span class="special">;</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_objattribute_polici0"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_objattribute_polici0" title="Class const_objattribute_policies static functions">Class
        <code class="computeroutput"><span class="identifier">const_objattribute_policies</span></code>
        static functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an object holding a string.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the attribute of target named by key.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                An object managing the result of the attribute access.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_objattribute_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_objattribute_policies" title="Class objattribute_policies">Class
        <code class="computeroutput"><span class="identifier">objattribute_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an attribute access
          to a mutable object when the attribute name is given as a const object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">objattribute_policies</span> <span class="special">:</span> <span class="identifier">const_objattribute_policies</span>
  <span class="special">{</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
      <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_objattribute_policies_stat"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_objattribute_policies_stat" title="Class objattribute_policies static functions">Class
        <code class="computeroutput"><span class="identifier">objattribute_policies</span></code> static
        functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an object holding a string.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                sets the attribute of target named by key to value.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                key is an object holding a string.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                deletes the attribute of target named by key.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_item_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_item_policies" title="Class const_item_policies">Class
        <code class="computeroutput"><span class="identifier">const_item_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an item access (via
          the Python bracket operators []) to a const object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">const_item_policies</span>
  <span class="special">{</span>
      <span class="keyword">typedef</span> <span class="identifier">object</span> <span class="identifier">key_type</span><span class="special">;</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_item_policies_static"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_item_policies_static" title="Class const_item_policies static functions">Class
        <code class="computeroutput"><span class="identifier">const_item_policies</span></code> static
        functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the item of target specified by key.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                An object managing the result of the item access.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_item_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_item_policies" title="Class item_policies">Class
        <code class="computeroutput"><span class="identifier">item_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an item access (via
          the Python bracket operators []) to a mutable object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">item_policies</span> <span class="special">:</span> <span class="identifier">const_item_policies</span>
  <span class="special">{</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
      <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_item_policies_static_funct"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_item_policies_static_funct" title="Class item_policies static functions">Class
        <code class="computeroutput"><span class="identifier">item_policies</span></code> static functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                sets the item of target specified by key to value.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                deletes the item of target specified by key.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_slice_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_slice_policies" title="Class const_slice_policies">Class
        <code class="computeroutput"><span class="identifier">const_slice_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an slice access (via
          the Python slice notation [x:y]) to a const object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">const_slice_policies</span>
  <span class="special">{</span>
      <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">handle</span><span class="special">&lt;&gt;,</span> <span class="identifier">handle</span><span class="special">&lt;&gt;</span> <span class="special">&gt;</span> <span class="identifier">key_type</span><span class="special">;</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_const_slice_policies_stati"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_const_slice_policies_stati" title="Class const_slice_policies static functions">Class
        <code class="computeroutput"><span class="identifier">const_slice_policies</span></code> static
        functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the slice of target specified by key.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                An object managing the result of the slice access.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_slice_policies"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_policies" title="Class slice_policies">Class
        <code class="computeroutput"><span class="identifier">slice_policies</span></code></a>
</h3></div></div></div>
<p>
          The policies which are used for proxies representing an slice access to
          a mutable object.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">struct</span> <span class="identifier">slice_policies</span> <span class="special">:</span> <span class="identifier">const_slice_policies</span>
  <span class="special">{</span>
      <span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
      <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_slice_policies_static_func"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_slice_policies_static_func" title="Class slice_policies static functions">Class
        <code class="computeroutput"><span class="identifier">slice_policies</span></code> static functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">set</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">,</span> <span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                sets the slice of target specified by key to value.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">target</span><span class="special">,</span> <span class="identifier">key_type</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                deletes the slice of target specified by key.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                if a Python exception is raised.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_template_object_operators"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_object_operators" title="Class template object_operators">Class
        template <code class="computeroutput"><span class="identifier">object_operators</span></code></a>
</h3></div></div></div>
<p>
          This is the base class of object and its proxy template used to supply
          common interface: member functions, and operators which must be defined
          within the class body. Its template parameter U is expected to be a class
          derived from object_operators&lt;U&gt;. In practice users should never
          use this class directly, but it is documented here because it supplies
          important interface to object and its proxies.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span>
  <span class="keyword">class</span> <span class="identifier">object_operators</span>
  <span class="special">{</span>
   <span class="keyword">public</span><span class="special">:</span>
      <span class="comment">// function call</span>
      <span class="comment">//</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()()</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">&gt;</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">&gt;</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="special">...</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,...</span><span class="keyword">class</span> <span class="identifier">An</span><span class="special">&gt;</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&amp;,...</span><span class="identifier">An</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="identifier">detail</span><span class="special">::</span><span class="identifier">args_proxy</span> <span class="keyword">operator</span><span class="special">*</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">args_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">args</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">args_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">args</span><span class="special">,</span>
                        <span class="identifier">detail</span><span class="special">::</span><span class="identifier">kwds_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">kwds</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="comment">// truth value testing</span>
      <span class="comment">//</span>
      <span class="keyword">typedef</span> <span class="identifier">unspecified</span> <span class="identifier">bool_type</span><span class="special">;</span>
      <span class="keyword">operator</span> <span class="identifier">bool_type</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="comment">// Attribute access</span>
      <span class="comment">//</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_attribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_attribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*);</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_objattribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_objattribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;);</span>

      <span class="comment">// item access</span>
      <span class="comment">//</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_item</span><span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_item</span><span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>

      <span class="comment">// slicing</span>
      <span class="comment">//</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_slice</span><span class="special">&gt;</span> <span class="identifier">slice</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">V</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">end</span><span class="special">)</span> <span class="keyword">const</span>

      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_slice</span><span class="special">&gt;</span> <span class="identifier">slice</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">V</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">end</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_template_object_operators_"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_object_operators_" title="Class template object_operators observer functions">Class
        template <code class="computeroutput"><span class="identifier">object_operators</span></code>
        observer functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">&gt;</span>
<span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">&gt;</span>
<span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">...</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">A0</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,...</span><span class="keyword">class</span> <span class="identifier">An</span><span class="special">&gt;</span>
<span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a2</span><span class="special">,...</span><span class="identifier">An</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">aN</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">call</span><span class="special">&lt;</span><span class="identifier">object</span><span class="special">&gt;(</span><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">)).</span><span class="identifier">ptr</span><span class="special">(),</span>
                <span class="identifier">a1</span><span class="special">,</span>
                <span class="identifier">a2</span><span class="special">,...</span><span class="identifier">aN</span><span class="special">)</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">args_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">args</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">call</span> <span class="identifier">object</span>
                <span class="identifier">with</span> <span class="identifier">arguments</span>
                <span class="identifier">given</span> <span class="identifier">by</span>
                <span class="identifier">the</span> <span class="identifier">tuple</span>
                <span class="identifier">args</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="identifier">object</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">args_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">args</span><span class="special">,</span>
                  <span class="identifier">detail</span><span class="special">::</span><span class="identifier">kwds_proxy</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">kwds</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">call</span> <span class="identifier">object</span>
                <span class="identifier">with</span> <span class="identifier">arguments</span>
                <span class="identifier">given</span> <span class="identifier">by</span>
                <span class="identifier">the</span> <span class="identifier">tuple</span>
                <span class="identifier">args</span><span class="special">,</span>
                <span class="keyword">and</span> <span class="identifier">named</span>
                <span class="identifier">arguments</span> <span class="identifier">given</span>
                <span class="identifier">by</span> <span class="identifier">the</span>
                <span class="identifier">dictionary</span> <span class="identifier">kwds</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">bool_type</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                Tests truth value of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">call</span><span class="special">&lt;</span><span class="identifier">object</span><span class="special">&gt;(</span><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">)).</span><span class="identifier">ptr</span><span class="special">(),</span>
                <span class="identifier">a1</span><span class="special">,</span>
                <span class="identifier">a2</span><span class="special">,...</span><span class="identifier">aN</span><span class="special">)</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_attribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">name</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_attribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">name</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                name is an <a class="link" href="../glossary.html#ntbs">ntbs</a>.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the named attribute of *this.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                a proxy object which binds <code class="computeroutput"><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">))</span></code> as its target, and name as its
                key.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_objattribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="identifier">name</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_objattribute</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="identifier">name</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Requires</span></dt>
<dd><p>
                name is a object holding a string.
              </p></dd>
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the named attribute of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                a proxy object which binds <code class="computeroutput"><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">))</span></code> as its target, and name as its
                key.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_item</span><span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_item</span><span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">[](</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">key</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the item of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> indicated by key.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                a proxy object which binds <code class="computeroutput"><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">))</span></code> as its target, and object(key)
                as its key.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">const_object_slice</span><span class="special">&gt;</span> <span class="identifier">slice</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">start</span><span class="special">;</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">V</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">finish</span><span class="special">)</span> <span class="keyword">const</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
<span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">object_slice</span><span class="special">&gt;</span> <span class="identifier">slice</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">start</span><span class="special">;</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">V</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">finish</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                accesses the slice of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> indicated by <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">object</span><span class="special">(</span><span class="identifier">start</span><span class="special">),</span> <span class="identifier">object</span><span class="special">(</span><span class="identifier">finish</span><span class="special">))</span></code>.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                a proxy object which binds <code class="computeroutput"><span class="identifier">object</span><span class="special">(*</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">*&gt;(</span><span class="keyword">this</span><span class="special">))</span></code> as its target, and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">object</span><span class="special">(</span><span class="identifier">start</span><span class="special">),</span>
                <span class="identifier">object</span><span class="special">(</span><span class="identifier">finish</span><span class="special">))</span></code>
                as its key.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_object"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object" title="Class object">Class
        <code class="computeroutput"><span class="identifier">object</span></code></a>
</h3></div></div></div>
<p>
          The intention is that object acts as much like a Python variable as possible.
          Thus expressions you'd expect to work in Python should generally work in
          the same way from C++. Most of object's interface is provided by its base
          class <code class="computeroutput"><span class="identifier">object_operators</span><span class="special">&lt;</span><span class="identifier">object</span><span class="special">&gt;</span></code>, and the free functions defined in
          this header.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">class</span> <span class="identifier">object</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">object_operators</span><span class="special">&lt;</span><span class="identifier">object</span><span class="special">&gt;</span>
  <span class="special">{</span>
   <span class="keyword">public</span><span class="special">:</span>
      <span class="identifier">object</span><span class="special">();</span>
      <span class="identifier">object</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
      <span class="keyword">explicit</span> <span class="identifier">object</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>

      <span class="special">~</span><span class="identifier">object</span><span class="special">();</span>

      <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;);</span>
      <span class="identifier">PyObject</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="keyword">bool</span> <span class="identifier">is_none</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_object_constructors_and_de"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object_constructors_and_de" title="Class object constructors and destructor">Class
        <code class="computeroutput"><span class="identifier">object</span></code> constructors and destructor</a>
</h3></div></div></div>
<pre class="programlisting"><span class="identifier">object</span><span class="special">();</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                Constructs an object managing a reference to the Python None object.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                nothing.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">explicit</span> <span class="identifier">object</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                converts x to python and manages a reference to it.
              </p></dd>
<dt><span class="term">Throws</span></dt>
<dd><p>
                <a class="link" href="../high_level_components/boost_python_errors_hpp.html#high_level_components.boost_python_errors_hpp.class_error_already_set" title="Class error_already_set">error_already_set</a>
                and sets a Python TypeError exception if no such conversion is possible.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="special">~</span><span class="identifier">object</span><span class="special">();</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                decrements the reference count of the internally-held object.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_object_modifiers"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_object_modifiers" title="Class object modifiers">Class
        <code class="computeroutput"><span class="identifier">object</span></code> modifiers</a>
</h3></div></div></div>
<pre class="programlisting"><span class="identifier">PyObject</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Returns</span></dt>
<dd><p>
                a pointer to the internally-held Python object.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">is_none</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Returns</span></dt>
<dd><p>
                result of <code class="computeroutput"><span class="special">(</span><span class="identifier">ptr</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">Py_None</span><span class="special">)</span></code>
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_template_proxy"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy" title="Class template proxy">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code></a>
</h3></div></div></div>
<p>
          This template is instantiated with various Policies described in this document
          in order to implement attribute, item, and slice access for object. It
          stores an object of type Policies::key_type.
        </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">python</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">api</span>
<span class="special">{</span>
  <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Policies</span><span class="special">&gt;</span>
  <span class="keyword">class</span> <span class="identifier">proxy</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">object_operators</span><span class="special">&lt;</span><span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">Policies</span><span class="special">&gt;</span> <span class="special">&gt;</span>
  <span class="special">{</span>
   <span class="keyword">public</span><span class="special">:</span>
      <span class="keyword">operator</span> <span class="identifier">object</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="keyword">const</span><span class="special">;</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
      <span class="keyword">inline</span> <span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="keyword">void</span> <span class="identifier">del</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>

      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&lt;&lt;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&gt;&gt;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&amp;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
      <span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
  <span class="special">};</span>
<span class="special">}}}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_template_proxy_observer_fu"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy_observer_fu" title="Class template proxy observer functions">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code> observer functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">object</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                applies <code class="computeroutput"><span class="identifier">Policies</span><span class="special">::</span><span class="identifier">get</span><span class="special">(</span><span class="identifier">target</span><span class="special">,</span> <span class="identifier">key</span><span class="special">)</span></code> with the proxy's target and key
                objects.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.class_template_proxy_modifier_fu"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.class_template_proxy_modifier_fu" title="Class template proxy modifier functions">Class
        template <code class="computeroutput"><span class="identifier">proxy</span></code> modifier functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">inline</span> <span class="identifier">proxy</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">Policies</span><span class="special">::</span><span class="identifier">set</span><span class="special">(</span><span class="identifier">target</span><span class="special">,</span>
                <span class="identifier">key</span> <span class="special">,</span>
                <span class="identifier">object</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">))</span></code>
                with the proxy's target and key objects.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&lt;&lt;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&gt;&gt;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">&amp;=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span>
<span class="identifier">proxy</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                for a given <code class="computeroutput"><span class="keyword">operator</span><span class="error">@</span><span class="special">=</span></code>,
                <code class="computeroutput"><span class="identifier">object</span><span class="special">(*</span><span class="keyword">this</span><span class="special">)</span> <span class="error">@</span><span class="special">=</span> <span class="identifier">rhs</span><span class="special">;</span></code>
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">del</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                Policies::del(target, key ) with the proxy's target and key objects.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.functions"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.functions" title="Functions">Functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="identifier">del</span><span class="special">(</span><span class="identifier">proxy</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">x</span><span class="special">.</span><span class="identifier">del</span><span class="special">()</span></code>
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&gt;(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&gt;=(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&lt;(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&lt;=(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                returns the result of applying the operator to <code class="computeroutput"><span class="identifier">object</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">object</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span></code>, respectively, in Python.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">+(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">-(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">*(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">/(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">%(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&gt;&gt;(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">&amp;(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">^(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span> <span class="keyword">operator</span><span class="special">|(</span><span class="identifier">L</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                returns the result of applying the operator to <code class="computeroutput"><span class="identifier">object</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span></code> and <code class="computeroutput"><span class="identifier">object</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span></code>, respectively, in Python.
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&lt;&lt;=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">)</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&gt;&gt;=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">&amp;=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">^=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">&gt;</span> <span class="identifier">object</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">|=(</span><span class="identifier">object</span><span class="special">&amp;</span><span class="identifier">l</span><span class="special">,</span><span class="identifier">R</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="identifier">r</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                assigns to <code class="computeroutput"><span class="identifier">l</span></code> the
                result of applying the corresponding Python inplace operator to
                <code class="computeroutput"><span class="identifier">l</span></code> and <code class="computeroutput"><span class="identifier">object</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span></code>,
                respectively.
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                l
              </p></dd>
</dl>
</div>
<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">len</span><span class="special">(</span><span class="identifier">object</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">obj</span><span class="special">);</span></pre>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">PyObject_Length</span><span class="special">(</span><span class="identifier">obj</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">())</span></code>
              </p></dd>
<dt><span class="term">Returns</span></dt>
<dd><p>
                <code class="computeroutput"><span class="identifier">len</span><span class="special">()</span></code>
                of object.
              </p></dd>
</dl>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="object_wrappers.boost_python_object_hpp.example"></a><a class="link" href="boost_python_object_hpp.html#object_wrappers.boost_python_object_hpp.example" title="Example">Example</a>
</h3></div></div></div>
<p>
          Python code:
        </p>
<pre class="programlisting"><span class="identifier">def</span> <span class="identifier">sum_items</span><span class="special">(</span><span class="identifier">seq</span><span class="special">):</span>
   <span class="identifier">result</span> <span class="special">=</span> <span class="number">0</span>
   <span class="keyword">for</span> <span class="identifier">x</span> <span class="identifier">in</span> <span class="identifier">seq</span><span class="special">:</span>
      <span class="identifier">result</span> <span class="special">+=</span> <span class="identifier">x</span>
   <span class="keyword">return</span> <span class="identifier">result</span>
</pre>
<p>
          C++ version
        </p>
<pre class="programlisting"><span class="identifier">object</span> <span class="identifier">sum_items</span><span class="special">(</span><span class="identifier">object</span> <span class="identifier">seq</span><span class="special">)</span>
<span class="special">{</span>
   <span class="identifier">object</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">object</span><span class="special">(</span><span class="number">0</span><span class="special">);</span>
   <span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">len</span><span class="special">(</span><span class="identifier">seq</span><span class="special">);</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
      <span class="identifier">result</span> <span class="special">+=</span> <span class="identifier">seq</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
   <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
<span class="special">}</span>
</pre>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2015 David Abrahams, Stefan Seefeld<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost_python_long_hpp.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../object_wrappers.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="boost_python_str_hpp.html"><img src="../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
